package com.seed.core.pojo.dto;

import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

/**
 * @author gchiaway
 * 日期: 2021-01-05
 * 时间: 16:21
 */
@Getter
@Setter
@ToString
public class SeedMessageDTO extends SeedBaseDTO {
    /**
     * 是否成功
     */
    private Boolean success;
    /**
     * 提示信息
     */
    private String message;
    /**
     * 提示编码
     */
    private String code;

    public SeedMessageDTO() {
        this.success = true;
        this.message = "操作成功";
        this.code = "000000";
    }

    public SeedMessageDTO(Boolean success, String message, String code) {
        this.success = success;
        this.message = message;
        this.code = code;
    }

    public SeedMessageDTO success() {
        this.success = true;
        this.message = "操作成功";
        this.code = "000000";
        return this;
    }

    public SeedMessageDTO success(String msg) {
        this.success = true;
        this.message = msg;
        this.code = "000000";
        return this;
    }

    public SeedMessageDTO success(String msg, String code) {
        this.success = true;
        this.message = msg;
        this.code = code;
        return this;
    }

    public SeedMessageDTO error() {
        this.success = false;
        this.message = "操作失败";
        this.code = "000000";
        return this;
    }

    public SeedMessageDTO error(String msg) {
        this.success = false;
        this.message = msg;
        this.code = "000000";
        return this;
    }

    public SeedMessageDTO error(String msg, String code) {
        this.success = false;
        this.message = msg;
        this.code = code;
        return this;
    }

}
